import request from '@/utils/request'

export function selectWorkTask(data) {
  return request({
    url: '/task/workTask',
    method: 'get',
    params: data
  })
}

export function selectTaskNumber() {
  return request({
    url: '/task/taskNumber',
    method: 'get'
  })
}

export function selectTaskByTime() {
  return request({
    url: '/task/taskByTime',
    method: 'get'
  })
}
export function selectTaskByWeek() {
  return request({
    url: '/task/taskByWeek',
    method: 'get'
  })
}

export function selectDoneTask(data) {
  return request({
    url: '/task/doneTask',
    method: 'get',
    params: data
  })
}

export function deleteTask(id) {
  return request({
    url: '/task/' + id,
    method: 'delete'
  })
}

export function submitTask(id) {
  return request({
    url: '/task/submit/' + id,
    method: 'put'
  })
}

export function addTask(data) {
  return request({
    url: '/task',
    method: 'post',
    data
  })
}

export function updateTask(data) {
  return request({
    url: '/task',
    method: 'put',
    data
  })
}
